package com.feisuanyz.response;

import lombok.*;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class RestResult<T> {

    private String code;
    private String msg;
    private T data;

    public static RestResult<Object> success(String message) {
        return new RestResult<>("000000", message, null);
    }

    public static RestResult<Object> success(String message, Object data) {
        return new RestResult<>("000000", message, data);
    }

    public static RestResult<Object> fail(String code, String message) {
        return new RestResult<>(code, message, null);
    }

    public static RestResult<Object> fail(String code, String message, Object data) {
        return new RestResult<>(code, message, data);
    }
}